package com.aranandroid.customview.ui

import android.annotation.SuppressLint
import android.app.Activity
import android.os.Bundle
import android.os.PersistableBundle
import android.widget.RadioButton
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.aranandroid.customview.R
import com.aranandroid.customview.squareview.SquareTextView
import kotlinx.android.synthetic.main.activity_progress.*
import kotlinx.android.synthetic.main.activity_square_textview.*
import kotlinx.android.synthetic.main.item_main.*
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking

class ProgressActivity : AppCompatActivity() {
    @SuppressLint("WrongViewCast")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_progress)

        round_progress.recharge = true
        var i = 0
        GlobalScope.launch {
            while (true) {
                if (i > 100) {
                    i = 0
                }
                runOnUiThread {
                    i++
                    round_progress.progress = i
                    round_progress2.progress = i
                    wave_progress.progress = i
                    line1.progress = i
                    line2.progress = i
                    line3.progress = i
                    line4.progress = i
                    line5.progress = i
                    line6.progress = i
                    line7.progress = i
                    line8.progress = i
                }
                delay(100)
            }
        }


    }


}